
// G参考代码

#include <bits/stdc++.h>
const int MAXN = 10 + 5;
using namespace std;
char S[MAXN];
int f[2][(1 << 10) + 5], now;
int n, m;
int tmp[15], nxt[15];

void StateToDP(int S, int g[]) {
  g[0] = 0;
  for (int i = 0; i < n; ++i) {
    g[i + 1] = g[i] + ((S >> i) & 1);
  }
}

int DPToState(int g[]) {
  int S = 0;
  for (int i = 0; i < n; ++i) {
    S |= ((g[i + 1] != g[i]) << i);
  }
  return S;
}

void nxtDP(int pre[], int nxt[], int c) {
  // pre:  f[1..n][j]
  // nxt: f[1..n][j+1]
  //  已知  T[j + 1] = c;
  nxt[0] = 0;
  for (int i = 1; i <= n; ++i) {
    f[i][j + 1] = max(f[i][j], f[i - 1][j + 1]);
    nxt[i] = max(pre[i], nxt[i - 1]);
    if (S[i] - 'a' == c) {
      f[i][j + 1] = f[i - 1][j] + 1;
      nxt[i] = max(nxt[i], pre[i - 1] + 1);
    }
  }
}

void add_old(int &x, int y) {
  x += y - mod;
  if (x < 0)
    x += mod;
}

void add(int &x, int y) {
  // 0 <= x,y < mod-1
  x += y - mod;
  x += x >> 31 & mod;
  add(x, 1ll * y * z % mod);
}

int ans[15];

int main() {
  scanf("%d%d", &n, &m);
  scanf("%s", S + 1);
  f[now][0] = 1;
  for (int i = 1; i <= m; ++i) {
    memset(f[now ^ 1], 0, sizeof(f[now ^ 1]));
    for (int S = 0; S < (1 << n); ++S) {
      if (!f[now][S])
        continue;
      StateToDP(S, tmp);
      for (int c = 0; c <= 25; ++c) {
        nxtDP(tmp, nxt, c);
        int nxtState = DPToState(nxt);
        add(f[now ^ 1][nxtState], f[now][S]);
      }
    }
    now ^= 1;
  }
  for (int S = 0; S < (1 << n); ++S) {
    StateToDP(S, tmp);
    add(ans[tmp[n]], f[now][S]);
  }
  for (int i = 0; i <= n; ++i)
    printf("%d ", ans[i]);
  return 0;
}